package com.zhq.blog.core.domain.admin;

import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import com.zhq.blog.core.domain.BaseRepository;


public interface OperatorRepository extends BaseRepository<Operator>{
	
	@Query("select b from Operator b where deleted=0  order by id desc  ")
	List<Operator> findAll();
	
	@Query("from Operator u  where u.name = :name AND u.password = :password AND deleted = 0")
	public List<Operator> findByLoginNameAndPassword(@Param("name") String name,@Param("password") String password);
	
	@Query("select g from Operator g where g.name = :name")
	List<Operator> findByName(@Param("name") String name);
}
